package com.szx.kaihei.pojo.dto;

import com.szx.kaihei.validators.ValidNInN;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Builder;
import lombok.Getter;

@Getter
@NotNull
@ValidNInN(fields = {"password","code"})
@Builder
public class LoginDto {
    /**
     * 用户id
     */
    private Long id;
    /**
     * 手机号
     */
    @NotNull(message = "手机号不能为空")
    //必须是手机号格式
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式错误")
    private String phone;

    /**
     * 密码
     */
    private String password;

    /**
     * 短信验证码
     */
    private String code;

    /**
     * 图形验证码
     */
    public String imageCaptcha;
}
